--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 6da36e2fb2c7a05e2c3409b5b64ac10d0190d9ca
Parents : 0b9face
Author : Sudo-Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-01-10T19:01:43-06:00
Fix version determination logic in build workflow
Changes
Diff
diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml
index 206fb74f..7297998d 100644
--- a/.gitea/workflows/build.yml
+++ b/.gitea/workflows/build.yml
@@ -34,22 +34,29 @@ jobs:
- name: Determine version
id: version
run: |
- if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then
- echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
+ VERSION=""
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
+ VERSION="${{ inputs.version || github.event.inputs.version }}"
+ fi
+
+ if [ -n "$VERSION" ]; then
+ echo "Using version from input: $VERSION"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
VERSION="${GITHUB_REF#refs/tags/}"
if [ -z "${VERSION}" ]; then
VERSION="${{ github.ref_name }}"
fi
- if [ "${VERSION}" = "master" ]; then
- echo "Error: Invalid tag name '${VERSION}'. Tag name cannot be a branch name." >&2
- exit 1
- fi
- echo "version=${VERSION}" >> $GITHUB_OUTPUT
+ echo "Using version from tag: $VERSION"
else
- SHORT_SHA=$(git rev-parse --short HEAD)
- echo "version=${SHORT_SHA}" >> $GITHUB_OUTPUT
+ VERSION=$(git rev-parse --short HEAD)
+ echo "Using version from SHA: $VERSION"
+ fi
+
+ if [ "${VERSION}" = "master" ] || [ -z "${VERSION}" ]; then
+ echo "Error: Invalid version '${VERSION}'. Version cannot be 'master' or empty." >&2
+ exit 1
fi
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Install NodeJS
uses: https://git.quad4.io/actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────